<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.util.Date" import="java.text.SimpleDateFormat" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    	               "http://www.w3.org/TR/html4/loose.dtd">

<html>
<jsp:useBean id="user" scope="request" class="model.User" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Khalid Albakr Finak Assignment</title>
</head>
<body>

	<% Date date = new Date();
	SimpleDateFormat simpDate;
    simpDate = new SimpleDateFormat("hh:mm:ss");
	String message;
	simpDate.format(date);
	if (date.getHours()>5 && date.getHours()<12){
		message ="Good morning";
	}
	else if( date.getHours()>= 12 && date.getHours()< 18){
		message ="Good after noon";
	}
	
	else {	
		message = "Good evening";
	}
	
	%>
	<br>
	<h3><% out.print(message+" "+ user.getLoginName()); %></h3>
	<h4>if you see this page that means you are logged in within the system</h4>
	<form action="RegisterServlet" method="post">
		<table>
			<tr>
				<td>Name:</td>
				<td><%= user.getName() %></td>
			</tr>
			<tr>
				<td>Email:</td>
				<td><%= user.getEmail() %></td>
			</tr>
			
			<tr>
				<td>Password:</td>
				<td><%= user.getPassword() %></td>
			</tr>

			
		</table>

	</form>

</body>
</html>
